package com.ruoyi.web.controller.douyin;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.annotation.RepeatSubmit;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.bo.DyAnchorBo;
import com.ruoyi.system.domain.bo.DyCustomerSumBo;
import com.ruoyi.system.domain.bo.DyVipSettingBo;
import com.ruoyi.system.domain.vo.DyAnchorCustomerVo;
import com.ruoyi.system.domain.vo.DyAnchorVo;
import com.ruoyi.system.domain.vo.DyVipSettingVo;
import com.ruoyi.system.service.IDyAnchorService;
import com.ruoyi.system.service.IDyVipSettingService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;

/**
 * vip设置
 *
 * @author ruoyi
 * @date 2024-06-20
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/system/vip")
public class DyVipSettingController extends BaseController {

    private final IDyVipSettingService iDyVipSettingService;

    /**
     * 查询vip设置列表
     */
    @GetMapping("/getVipSettingPage")
    public TableDataInfo<DyVipSettingVo> getVipSettingPage(DyVipSettingBo bo, PageQuery pageQuery) {
        return iDyVipSettingService.getVipSettingPage(bo, pageQuery);
    }

    /**
     * 获取vip列表（无分页）
     *
     * @param bo
     */
    @PostMapping("/getVipSettingList")
    public R<List<DyVipSettingVo>> getVipSettingList(@RequestBody DyVipSettingBo bo) {
        return R.ok(iDyVipSettingService.getVipSettingList(bo));
    }

    /**
     * 新增vip设置
     */
    @RepeatSubmit()
    @PostMapping("/addDyVipSetting")
    public R<Void> addDyVipSetting(@RequestBody DyVipSettingBo bo) {
        return toAjax(iDyVipSettingService.addDyVipSetting(bo));
    }

    /**
     * 修改vip设置
     */
    @RepeatSubmit()
    @PostMapping("/updDyVipSetting")
    public R<Void> updDyVipSetting(@RequestBody DyVipSettingBo bo) {
        return toAjax(iDyVipSettingService.updDyVipSetting(bo));
    }

    /**
     * 删除vip设置
     *
     * @param bo 主键
     */
    @PostMapping("/delDyVipSetting")
    public R<Void> delDyVipSetting(@RequestBody DyVipSettingBo bo) {
        return toAjax(iDyVipSettingService.delDyVipSetting(bo));
    }

}
